package com.itheima.controller;

import com.itheima.factory.BeanFactory;
import com.itheima.service.RoleService;
import com.itheima.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserController {
    @Test
    public void test1() {
        //创建spring核心容器IOC
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
        //获取Bean对象
        UserService userService = (UserService)ac.getBean("userService");
        //调用方法
        userService.findAll();
    }
}